/* $Id: IBtFunction.java,v 1.3 2002/01/29 02:04:08 ndp Exp $
**/
using System;
using NDODS.DAP.BaseTypes;

namespace NDODS.DAP.Server
{
	
	/// <summary>Represents a server-side function, which evaluates to a BaseType.
	/// Custom server-side functions which return non-bool values should
	/// implement this interface.  For an efficient implementation, it is
	/// suggested, when possible, to use the same BaseType for the getType()
	/// method and for each successive invocation of Evaluate(), changing only
	/// the BaseType's value. This avoids creation of large numbers of
	/// BaseTypes during a data request.
	/// </summary>
	/// <seealso cref="BTFunctionClause">
	/// </seealso>
	/// <author>  joew 
	/// </author>
	public interface IBtFunction:IServerSideFunction
	{
		
		/// <summary>A given function must always Evaluate to the same class 
		/// of BaseType. Only the value held by the BaseType may change.
		/// This method can be used to discover the BaseType class of a 
		/// function without actually evaluating it.
		/// </summary>
		BaseType getReturnType(System.Collections.IList args);
		
		/// <summary>Evaluates the function using the argument list given.</summary>
		/// <exception cref="SDODSException">Thrown if the function
		/// cannot Evaluate successfully. The exact type of exception is up
		/// to the author of the server-side function.
		/// </exception>
		BaseType evaluate(System.Collections.IList args);
	}
}